package com.springboot7x.demo.controller;

import com.springboot7x.demo.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloCtroller {
    @Value("${person.name}")
    private String name;

    @Autowired
    Person person;

    @Value("${JAVA_HOME}")
    private String msg;

    @Value("${os.name}")
    private String name1;

    @GetMapping("/")
    public String  Hellcontroller(){
        return person.getClass().toString();
    }
    @GetMapping("/persion")
    public Person test2(){
        return person;
    }
    @GetMapping("/msg")
    public String test3(){
        return msg;
    }

    @GetMapping("/xx")
    public String test4(){
        return name1;
    }


}
